{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>Content</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp"/>
  <link rel="icon" type="image/png" href="{% static 'assets/i/favicon.png' %}">
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="{% static 'assets/i/app-icon72x72@2x.png' %}">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <link rel="apple-touch-icon-precomposed" href="{% static 'assets/i/app-icon72x72@2x.png' %}">
  <meta name="msapplication-TileImage" content="{% static 'assets/i/app-icon72x72@2x.png' %}">
  <meta name="msapplication-TileColor" content="#0e90d2">
  <link rel="stylesheet" href="{% static 'assets/css/amazeui.min.css' %}">
  <link rel="stylesheet" href="{% static 'assets/css/app.css' %}">
</head>

<body id="blog-article-sidebar">
<!-- header start -->
<header class="am-g am-g-fixed blog-fixed blog-text-center blog-header">
    <div class="am-u-sm-8 am-u-sm-centered">
        <img width="200" src="{% static 'images/pythonstudy.png' %}" alt=""/>
        <h2 class="am-hide-sm-only">Python学习社区，支持移动设备</h2>
    </div>
</header>
<!-- header end -->
<hr>

<!-- nav start -->
<nav class="am-g am-g-fixed blog-fixed blog-nav">
<button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only blog-button" data-am-collapse="{target: '#blog-collapse'}" ><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

  <div class="am-collapse am-topbar-collapse" id="blog-collapse">
    <ul class="am-nav am-nav-pills am-topbar-nav">
     <li class="am-active"><a href="/">首页</a></li>
      <li class="am-dropdown" data-am-dropdown>
        <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
          话题 <span class="am-icon-caret-down"></span>
        </a>
        <ul class="am-dropdown-content">
         {% for t in topics %}
          <li><a href="/topic/{{ t.id }}">{{ t.tname }}</a></li>
         {% endfor %}
        </ul>
      </li>
      {% if request.session.s_name_001 %}
      <li><a href="/post">写文章</a></li>
      <li><a href="/logout">注销</a></li>
      {% else %}
      <li><a href="/login">登录</a></li>
      <li><a href="/register">注册</a></li>
      {% endif %}
      <li><a href="/archive">文章归档</a></li>
    </ul>
    <form class="am-topbar-form am-topbar-right am-form-inline" role="search">
      <div class="am-form-group">
          {% if request.session.s_name_001 %}{{ request.session.s_name_001 }},您好！{% endif %}
        <input type="text" class="am-form-field am-input-sm" placeholder="搜索">
      </div>
    </form>
  </div>
</nav>
<!-- nav end -->
<hr>
<!-- content srart -->
<div class="am-g am-g-fixed blog-fixed blog-content">
    <div class="am-u-sm-12">
      <article class="am-article blog-article-p">
        <div class="am-article-hd">
          <h1 class="am-article-title blog-text-center">{{ article.title }}</h1>
          <p class="am-article-meta blog-text-center">
              <span><a href="/topic/{{ article.topic_id }}" class="blog-color">{{ article.topic }} &nbsp;</a></span>-
              <span>{% for i in article.author.all %}{{ i.nickname }} {% endfor %} &nbsp;</span>-
              <span>{{ article.publish_date }}</span>
          </p>
        </div>
        <div class="am-article-bd">
        <img src="../../static/userimg/{{ article.image }}" alt="" class="blog-entry-img blog-article-margin">
         {{ article.content | safe }}
        </div>
      </article>

        <div class="am-g blog-article-widget blog-article-margin">
          <div class="am-u-lg-4 am-u-md-5 am-u-sm-7 am-u-sm-centered blog-text-center">
            <span class="am-icon-tags"> &nbsp;</span><a href="#">标签</a> , <a href="#">TAG</a> , <a href="#">啦啦</a>
            <hr>
            <a href=""><span class="am-icon-qq am-icon-fw am-primary blog-icon"></span></a>
            <a href=""><span class="am-icon-wechat am-icon-fw blog-icon"></span></a>
            <a href=""><span class="am-icon-weibo am-icon-fw blog-icon"></span></a>
          </div>
        </div>

        <hr>
    {% for c in article.comment_set.all %}
        <div class="am-g blog-author blog-article-margin">
          <div class="am-u-sm-3 am-u-md-3 am-u-lg-2">
            <img src="{% static 'assets/i/f15.jpg' %}" alt="" class="blog-author-img am-circle">
          </div>
          <div class="am-u-sm-9 am-u-md-9 am-u-lg-10">
          <h3><span>评论人 &nbsp;: &nbsp;</span><span class="blog-color">{{ c.commentator.nickname }}</span></h3>
            <p>{{ c.content }}</p>
          </div>
        </div>
    {% endfor %}
        <hr>
        <ul class="am-pagination blog-article-margin">
          <li class="am-pagination-prev"><a href="/article/{{ pres.id }}" class="">&laquo; 上一篇</a></li>
          <li class="am-pagination-next"><a href="/article/{{ nexts.id }}">下一篇 &raquo;</a></li>
        </ul>

        <hr>

        <form method="post" action="/comment/{{ article.id }}/" class="am-form am-g">
            {% csrf_token %}
            <h3 class="blog-comment">评论</h3>
          <fieldset>
              <input type="hidden" name="commentator" value="{{ request.session.s_name_001 }}">
            <div class="am-form-group">
              <textarea name="content" class="" rows="5" placeholder="回复内容"></textarea>
            </div>
            <p>{% if request.session.s_name_001 %}<button type="submit" class="am-btn am-btn-default">发表评论</button>
            {% else %}
                登录后发表评论
            {% endif %}</p>
          </fieldset>
        </form>
        <hr>
    </div>
</div>
<!-- content end -->

  <footer class="blog-footer">
    <div class="am-g am-g-fixed blog-fixed am-u-sm-centered blog-footer-padding">
        <div class="am-u-sm-12 am-u-md-4- am-u-lg-4">
            <h3>模板简介</h3>
            <p class="am-text-sm">这是一个使用amazeUI做的简单的前端模板。<br> 博客/ 资讯类 前端模板 <br> 支持响应式，多种布局，包括主页、文章页、媒体页、分类页等<br>嗯嗯嗯，不知道说啥了。外面的世界真精彩<br><br>
            Amaze UI 使用 MIT 许可证发布，用户可以自由使用、复制、修改、合并、出版发行、散布、再授权及贩售 Amaze UI 及其副本。</p>
        </div>
        <div class="am-u-sm-12 am-u-md-4- am-u-lg-4">
            <h3>社交账号</h3>
            <p>
                <a href=""><span class="am-icon-qq am-icon-fw am-primary blog-icon blog-icon"></span></a>
                <a href=""><span class="am-icon-github am-icon-fw blog-icon blog-icon"></span></a>
                <a href=""><span class="am-icon-weibo am-icon-fw blog-icon blog-icon"></span></a>
                <a href=""><span class="am-icon-reddit am-icon-fw blog-icon blog-icon"></span></a>
                <a href=""><span class="am-icon-weixin am-icon-fw blog-icon blog-icon"></span></a>
            </p>
            <h3>Credits</h3>
            <p>我们追求卓越，然时间、经验、能力有限。Amaze UI 有很多不足的地方，希望大家包容、不吝赐教，给我们提意见、建议。感谢你们！</p>
        </div>
        <div class="am-u-sm-12 am-u-md-4- am-u-lg-4">
              <h1>我们站在巨人的肩膀上</h1>
             <h3>Heroes</h3>
            <p>
                <ul>
                    <li>jQuery</li>
                    <li>Zepto.js</li>
                    <li>Seajs</li>
                    <li>LESS</li>
                    <li>...</li>
                </ul>
            </p>
        </div>
    </div>
    <div class="blog-text-center">© 2018 AllMobilize, Inc. 鲁ICP备16036909 蜂山二路</div>
  </footer>

<script src="{% static 'assets/js/jquery.min.js' %}"></script>
<script src="{% static 'assets/js/amazeui.min.js' %}"></script>
</body>
</html>